package com.wtwd.campus.wx.wxtemplate;

/**
 * @author mjy
 * @date 2022/09/23
 * @description
 */
public enum WxTemplateEnum {


    CQGD_ENTRY_FENCE_TEMPLATE("A01A03A23A03", "", 1, "重庆广电进围栏提醒"),

    CQGD_OUT_OF_FENCE_TEMPLATE("A01A03A23A03", "", 2, "重庆广电出围栏提醒"),

    CQGD_INFORMATION_FENCE_TEMPLATE("A01A03A23A03", "", 3, "重庆广电咨询提醒"),

    CQGD_SOS_FENCE_TEMPLATE("A01A03A23A03", "", 4, "重庆广电sos提醒"),


    LW_ENTRY_FENCE_TEMPLATE("A01A03A26", "p6xilwDw8jm_1cxdbs0U56vo2cYyymc9YKEL2TJQkmU", 1, "雷纹进围栏提醒"),

    LW_OUT_OF_FENCE_TEMPLATE("A01A03A26", "p6xilwDw8jm_1cxdbs0U56vo2cYyymc9YKEL2TJQkmU", 2, "雷纹出围栏提醒"),

    LW_INFORMATION_FENCE_TEMPLATE("A01A03A26", "p6xilwDw8jm_1cxdbs0U56vo2cYyymc9YKEL2TJQkmU", 3, "雷纹咨询提醒--家长私信提醒"),

    LW_SOS_FENCE_TEMPLATE("A01A03A26", "p6xilwDw8jm_1cxdbs0U56vo2cYyymc9YKEL2TJQkmU", 4, "雷纹sos提醒"),


    XB_ENTRY_FENCE_TEMPLATE("A01A03A23", "8PQhbo7ZNW4xLQXTtrd6nia-63J70-swYwLjKew1XBE", 1, "小湃进围栏提醒"),

    XB_OUT_OF_FENCE_TEMPLATE("A01A03A23", "n38uCSled_W2ALBR94G38iBmIDVgRKzfqsQCMKjtAPc", 2, "小湃出围栏提醒"),

    XB_INFORMATION_FENCE_TEMPLATE("A01A03A23", "tXytQp9ioAuAJj1cpUMgXcW0N47TLW-Jgt-wsQa_thA", 3, "小湃咨询提醒--家长私信提醒"),

    XB_SOS_FENCE_TEMPLATE("A01A03A23", "NmER7_EeQusdA3UPMmVM-5g-6a2JgCdBWleJkoiYGnw", 4, "小湃sos提醒"),
    ;

    /**
     * 进围栏
     */
    public static Integer ENTRY_FENCE_TYPE = 1;

    /**
     * 出围栏
     */
    public static Integer OUT_OF_FENCE_TYPE = 2;

    /**
     *
     */
    public static Integer INFORMATION_TEMPLATE_TYPE = 3;

    /**
     * sos推送模板
     */
    public static Integer SOS_TEMPLATE_TYPE = 4;


    /**
     * 微信客户id
     * 客户id
     */
    private String customerCode;

    /**
     * 客户对应模板id
     */
    private String template;

    private Integer type;

    /**
     * 模板描述
     */
    private String msg;

    public String getCustomerCode() {
        return customerCode;
    }

    public void setCustomerCode(String customerCode) {
        this.customerCode = customerCode;
    }

    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    WxTemplateEnum(String customerCode, String template, Integer type, String msg) {
        this.customerCode = customerCode;
        this.template = template;
        this.type = type;
        this.msg = msg;
    }

    /**
     * 根据客户id,推送类型获取唯一推送唯一枚举
     *
     * @param customerCode
     * @param type
     * @return
     */
    public static WxTemplateEnum getWxTemplateEnum(String customerCode, Integer type) {
        for (WxTemplateEnum r : WxTemplateEnum.values()) {
            if (r.getCustomerCode().equals(customerCode) && r.getType() == type) {
                return r;
            }
        }
        return null;
    }


}
